<?php

class m140128_135659_create_useractivitylog_table extends CDbMigration
{
	const TABLE = 'user_activity';

	public function up()
	{
		$this->createTable(self::TABLE, array(
			'id' 	   		=> 'pk',
			'entity'   		=> 'string not null',
			'entity_id'		=> 'string not null',
			'user_id'  		=> 'int not null',
			'action'   		=> 'string not null',
			'previous_data' => 'text null default null',
			'current_data'  => 'text null default null',
			'description'   => 'text null default null',
			'create_time'   => 'timestamp null default null',
		));
	}

	public function down()
	{
		$this->dropTable(self::TABLE);
	}
}
